import axios from '@/libs/api.request'

/**
 * 获取应用数据
 * @returns {wx.RequestTask | never}
 */
export const getList = (params) => {
  return axios.request({
    url: 'Mail/index',
    method: 'get',
    params: params
  })
}

/**
 * 启用/禁用接口
 * @param status
 * @param hash
 * @returns {wx.RequestTask | never}
 */
export const changeStatus = (status, id, game_hash) => {
  return axios.request({
    url: 'Mail/changeStatus',
    method: 'get',
    params: {
      status: status,
      id: id,
      game_hash: game_hash
    }
  })
}

/**
 * 新增应用
 * @param data
 * @returns {wx.RequestTask | never}
 */
export const add = (data) => {
  return axios.request({
    url: 'Mail/add',
    method: 'post',
    data
  })
}

export const log = (params) => {
  return axios.request({
    url: 'Mail/log',
    method: 'get',
    params
  })
}

export const getMailInfo = (data) => {
  return axios.request({
    url: 'Mail/getMailInfo',
    method: 'post',
    data
  })
}
